package com.sg.dto.integration.framework;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

/**
 * @desc CodeByCodeDto
 * @使用场景
 */
@Data
public class CodeByCodeDto extends BaseDto implements Serializable {

    /**
     * 编码ID
     */
    @ApiModelProperty("编码ID")
    private String codeId;

    /**
     * 编码
     */
    @ApiModelProperty("编码")
    private String code;

    /**
     * 编码名称
     */
    @ApiModelProperty("编码名称")
    private String codeName;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        CodeByCodeDto that = (CodeByCodeDto) o;
        return (
                codeId == that.codeId && code == that.code && codeName == that.codeName
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), codeId, code, codeName);
    }

}
